# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        黄周云  
# Name:         test04
# Description: 例25.4
# Author:       ASUS
# Date:         2019/4/8
#-------------------------------------------------------------------------------


import pandas
df = pandas.read_csv("gapminder.tsv",sep="\t")
subset = df.loc[:,['year','pop']]
print(subset.head(2))
print("---------------------")
subset = df.loc[1,'lifeExp']
print(subset)
print("------------------------")
subset = df.iloc[:,[2,4,-1]]
print(subset.head(2))
print("-------------------------")
subset = df.iloc[:,3:6]
print(subset.head(2))
print("-----------------------")
subset = df.iloc[0:3,3:6]


